<?php require_once 'header.php';?>    
<!-- DataTables Responsive CSS -->
    <link href="sb2/vendor/datatables-responsive/dataTables.responsive.css" rel="stylesheet">
        <!-- Page Content -->
        <div id="page-wrapper">
            <div class="container-fluid">
                <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                        <?php echo XXF_BACK?>
                        <?php echo XXF_LNAME?>
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                        	<div style="text-align: center;font-size:18px;font-weight:900;padding:10px;"><?php echo $result['ntitle']?></div>
                        	<div style="font-size: 8px;color:#999;text-align:center;">
                        		发布人：<?php echo xdb::getInstance()->getvar("select realname from user where id=".$result['uid'])?> 
                        		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        		发布时间：<?php echo $result['atime']?>
                        	</div>
                        	<hr style="margin-top: 5px;">
                        	<div><?php echo html_entity_decode($result['ncontent'])?></div>
                        	<hr>
                        	<div>评论区：</div>
                        	<?php 
                        	foreach ($pinglun as $row){
                        	?>
                        	<div style="background-color: #eee;padding:15px;padding-right:40px;margin:15px;">
                        		<div>
                            		<?php echo html_entity_decode($row['content'])?>
                            	</div>
                            	<br>
                            	<div style="text-align: right;font-size:12px;">
                                	评论人：<?php echo xdb::getInstance()->getvar("select realname from user where id=".$row['uid'])?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                	评论时间：<?php echo $row['atime']?>
                                </div>
                        	</div>
                        	<?php 
                        	}
                        	?>
                        	<hr>
                        	<div>回复：</div>
                        	<textarea name="content" style="width:100%;visibility:hidden;" id="pl" >已阅</textarea>
                        	<button class='btn btn-success'  style="margin-top: 3px;" onclick="huifu()">回复</button>
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
             </div>
        </div>
        <!-- /#page-wrapper -->
  </div>
        <!-- DataTables JavaScript -->
<?php require_once 'bottom.php';?>
<script charset="utf-8" src="kindeditor/kindeditor-all.js"></script>
<script>
var editor1;
KindEditor.ready(function(K) {
	editor1 = K.create('textarea[name="content"]', {
		resizeType : 1,
		allowPreviewEmoticons : false,
		items : [
            'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
            'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
            'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
            'superscript', 'clearhtml', 'quickformat', 'selectall', '|',
            'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
            'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
            'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap'
        ]
	});
});
function huifu(){
	editor1.sync();
	$content=$("[name='content']").val();
	$.xpost("gongwenread",{type:"pinglunadd",ugnid:<?php echo $ugnid?>,content:$content},function(data){
		if(data==1){
			location.reload();
		}else{
			console.log(data);
		}
	})
}
</script>